from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import AgentViewSet, WorkflowViewSet, WorkflowExecutionViewSet

router = DefaultRouter()
router.register(r'agents', AgentViewSet)
router.register(r'workflows', WorkflowViewSet)
router.register(r'workflow-executions', WorkflowExecutionViewSet)

urlpatterns = [
    path('', include(router.urls)),
    path('agents/bulk/', AgentViewSet.as_view({'put': 'bulk_update'}), name='agent-bulk-update'),
    path('workflows/<int:pk>/execute/', WorkflowViewSet.as_view({'post': 'execute'})),
    path('workflows/<int:pk>/executions/', WorkflowViewSet.as_view({'get': 'executions'})),
    path('workflows/<int:pk>/execute-sync/', WorkflowViewSet.as_view({'post': 'execute_sync'})),
]
